/**
 *
 * Copyright 2016 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

* {
  box-sizing: border-box;
}

html, body {
  padding: 0;
  margin: 0;
  font-size: 24px;
  font-family: Arial, sans-serif;
}

sc-view {
  contain: strict;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0,0,0.3,1),
    opacity 0.3s cubic-bezier(0,0,0.3,1);
  font-size: 20vh;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  color: white;
}

sc-view.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

sc-view[remote]::before {
  opacity: 0;
  pointer-events: none;
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  transition: opacity 0.3s cubic-bezier(0,0,0.3,1);
}

sc-view[remote]::after {
  opacity: 0;
  pointer-events: none;
  content: '';
  position: fixed;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  background: url(images/spinner.png) center center no-repeat;
  background-size: 40px 40px;
  animation-name: spin;
  animation-duration: 1s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  transition: opacity 0.3s cubic-bezier(0,0,0.3,1);
}

sc-view[remote].pending::before,
sc-view[remote].pending::after {
  opacity: 1;
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.view-home {
  background: rgb(128,00,64);
}

.view-contact {
  background: rgb(00,128,64);
}

.view-about {
  background: rgb(00,64,128);
}

.view-misc {
  background: rgb(128,64,0);
}

nav {
  position: fixed;
  right: 10px;
  top: 10px;
  background: #FFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  padding: 10px 30px 10px 10px;
  border-radius: 3px;
  z-index: 1;
}

body.offline nav a {
  opacity: 0.3;
  pointer-events: none;
}

body.offline nav a.cached {
  opacity: 1;
  pointer-events: initial;
}
